/*
 * @Author: your name
 * @Date: 2021-07-07 15:01:29
 * @LastEditTime: 2021-08-05 13:44:35
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \exc-tl1-2\SRC\user_src\device_time.h
 */
/**
	*文件名称：
	*
	*文件日期：
	*
	*文件描述：
	*
	*文件版本：V1.0
	*
	*/

#ifndef DEVICE_TIME_H
#define DEVICE_TIME_H

/* 头文件包含区	*/
#include "stdint.h"
#include "rtc.h"
#include "protocol.h"
#include "math.h"

/* 宏定义区 */
#define M_PI 3.14

typedef struct
{
  double RAD;
  double sunset;
  double midDayTime;
  double dawnTime;
  double longitude;
  double dimensionality;
  uint8_t sunset_s;
  uint8_t sunrise_s;
  uint8_t my_week;
} sun_struct;

/* 函数声明区 */
void set_rtc_time(uint8_t y, uint8_t mon, uint8_t d, uint8_t h, uint8_t min, uint8_t s);
uint32_t TimeDate_To_TimeStamp(uint16_t year, uint8_t mon, uint8_t date, uint8_t hour, uint8_t min, uint8_t sec);
char CaculateWeekDay(int y, int m, int d);
void get_rtc_time(void);
void get_sunset_rise_time(void);
char Is_Leap_Year(uint8_t year);
#endif
